package xp.ass.imitate.express.meta;

import lombok.Data;

import java.util.Arrays;

/**
 * @author chent3
 * @date 2024/8/23
 */
@Data
public class XToken {

    XTokenKind xTokenKind;

    String data;

    int startPos;

    int endPos;

    public XToken(XTokenKind xTokenKind, int startPos, int endPos) {
        this.xTokenKind = xTokenKind;
        this.startPos = startPos;
        this.endPos = endPos;
    }

    public String getData(String originExpression) {
        return originExpression.substring(this.startPos, endPos);
    }


}
